package senior.ListExer.Exer3;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author shkstart
 * @creat 2022-04-9:24
 */
public class ListTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List list = new ArrayList<>();
        list.add("a");
        list.add(Math.E);
        list.add(23);
        int size = list.size();

        for(Object o:list){
            System.out.println(o);
        }
        System.out.println("大小：" + size);
        System.out.println("输入");
        boolean b = list.contains(sc.next());
        System.out.println("是否包含a?" + b);
        boolean b1 = list.remove(Math.E);
        for(Object o:list){
            System.out.println(o);
        }
        System.out.println("大小：" + size);

        list.add("dog");
        list.add("dog");
        for(Object o:list){
            System.out.println(o);
        }
        System.out.println("大小：" + size);
        Object o = list.get(3);
        System.out.println(o);
        System.out.println("输入要删除的位置");

        Object o1 = list.remove(sc.nextInt());
        System.out.println("删除了"+o1);
        for(Object o0:list){
            System.out.println(o0);
        }
        System.out.println("大小：" + size);


    }
}
